package com.sc.nft.controller;

import com.sc.nft.annotation.UserLogin;
import com.sc.nft.entity.dto.RegionLinkedDTO;
import com.sc.nft.service.SysRegionService;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/sysRegion")
@Api(tags = "省市区地区内容")
public class SysRegionController {

    private final SysRegionService sysRegionService;

    @ApiOperation(value = "地区联动", notes = "地区联动", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/regionLinked", produces = MediaType.APPLICATION_JSON_VALUE)
    @UserLogin
    public Result regionLinked(@RequestBody RegionLinkedDTO regionLinkedDTO) {
        return Result.success(sysRegionService.regionLinked(regionLinkedDTO));
    }

}
